<template>
	<div class="Word">
	  <div style="height: 800px; width: auto" v-html="poHtmlCode" />
	</div>
</template>

<script>
import axios from 'axios';
	  export default{
	    name: 'Word',
	    data(){
	      return {
	        poHtmlCode: '',
	
	      }
	    },
	    created: function(){
	      //由于vue中的axios拦截器给请求加token都得是ajax请求，所以这里必须是axios方式去请求后台打开文件的controller
	      axios.post("/api/InsertSeal/Word/AddSign/Word2").then((response) => {
	        this.poHtmlCode = response.data;
	
	      }).catch(function (err) {
	        console.log(err)
	      })
	    },
	    methods:{
	      //控件中的一些常用方法都在这里调用，比如保存，打印等等
			Save() {
				pageofficectrl.WebSave();
			},

			InsertHandSign() {
				try {
					pageofficectrl.zoomseal.AddHandSign("李志");
				} catch (e) {
				}
			},

			ChangePsw() {
				pageofficectrl.zoomseal.ShowSettingsBox();
			},
			OnPageOfficeCtrlInit() {
        		// PageOffice的初始化事件回调函数，您可以在这里添加自定义按钮
				pageofficectrl.AddCustomToolButton("保存", "Save", 1);
				pageofficectrl.AddCustomToolButton("签字", "InsertHandSign()", 2);
				if(("linux")!=(pageofficectrl.ClientOS)){ 				
					pageofficectrl.AddCustomToolButton("修改密码", "ChangePsw()", 0);
				}
        
      		},
	    },
	    mounted: function(){
	      // 将vue中的方法赋值给window
		    window.OnPageOfficeCtrlInit=this.OnPageOfficeCtrlInit;
			window.Save = this.Save;
			window.InsertHandSign = this.InsertHandSign;
			window.ChangePsw = this.ChangePsw;
	    }
	}
</script>

